﻿#include "tools.h"


std::vector<QString> tools::GetFileList(QString dir)
{
    std::vector<QString> filePath;
    QDir dirPath(dir);
    QList<QFileInfo> file(dirPath.entryInfoList());
    QString name = "";

    for (auto it = file.begin(); it != file.end(); it++)
    {
        name = dir + "/" + it->fileName();
        if (it->isFile())
        {
            filePath.push_back(name);
            //qDebug()<<name;
        }
    }
    return filePath;
}

QString tools::ToTime(qint64 time)//转换时间
{
    qint64 seconds=time/1000;
    const qint64 minutes=seconds/60;
    seconds-=minutes*60;
    return QStringLiteral("%1:%2")
            .arg(minutes, 2, 10, QLatin1Char('0'))
            .arg(seconds, 2, 10, QLatin1Char('0'));
}
